# encoding: utf-8
from flask_marshmallow import base_fields
from app.modules.common.parameters import BaseParameters


class AppAddParameters(BaseParameters):
    app_id = base_fields.String(
        description = "app id",
        required = True
    )
    app_name = base_fields.String(
        description = "app 名",
        required = True
    )
    port = base_fields.String(
        description = "应用端口",
        required = True
    )
    zone_code = base_fields.String(
        description = "区域code",
        required = True
    )
    db_type = base_fields.String(
        description = "应用数据库类型",
        required = False,
        missing = None
    )
    db_name = base_fields.String(
        description = "应用数据库名",
        required = False,
        missing = None
    )
    app_type = base_fields.String(
        description = "应用类型",
        required = True,
        enum = ['tomcat', 'php', 'adempiere', 'spring-boot'],
        default = 'tomcat'
    )
    on_beetle = base_fields.String(
        description = "是否用beetle管理",
        required = True,
        enum = ['true', 'false'],
        default = 'true'
    )
    starting_order = base_fields.String(
        description = "启动顺序",
        required = True,
        missing = "999999"
    )
